package com.superm.controller;

import com.superm.entity.SaleOrder;
import com.superm.entity.SaleOrderDetails;
import com.superm.service.SaleODetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping(path = "/saleOrderD")
public class SaleODController {
    @Autowired
    private SaleODetService saleODetService;
    @RequestMapping(path = "/allsaleOrderD")
    @ResponseBody
    public Map<String, Object> allsaleOrderD(Integer saleOrderId){
        Map<String, Object> map = new HashMap<>();
        map.put("code",0);
        List<SaleOrderDetails> saleOrderDs =saleODetService.allSaleOid(saleOrderId);
        map.put("data",saleOrderDs);
        return map;
    }
}
